/**
 * Created by Jay on 2016/6/13.
 */
function  message_center_jh(){
    //删除
    $("body").on("click",".delete_m",function(){
        var this_id=$(this).attr("data-fid");
        layer.open({
            content: '是否删除',
            btn: ['确认', '取消'], //可以无限个按钮
            yes: function(index, layero){
                mccmsa.ajax({
                    url: "messageController/delFeedback",
                    method: "get",
                    data: {id:this_id},
                    success: function (data) {
                        layer.alert("成功删除");
                        mccmsa.hashChange();
                    }
                })
            },
            no : function(index, layero){
                layer.close(index); //如果设定了yes回调，需进行手工关闭
            }
        });
    })
    //搜索
    $("body").on("click",".rep_search",function(){
        var search_val=$(".rep_search_real").val();
        if(search_val==""){
            sessionStorage.setItem("this_page_click_num","1");
        //    fix bug!!!! 跳页后没有改变this_page_click_num！！！ 因此在这改！！！
        }else{
            var create_num_1=sessionStorage.getItem("this_page_click_num");
            if(create_num_1!=1){
                sessionStorage.setItem("this_page_click_num","1");
            }
        }
        mccmsa.ajax({
            url: "messageController/searchFeedbackInfo",
            method: "POST",
            data: {pageSize: 10, pageNo: 1,content:search_val},
            success: function (data) {
                if(data.result.length>1){
                    create_page({
                        url:"messageController/searchFeedbackInfo",
                        method:"POST",
                        data:data,
                        temp:"getColumnTableData_mess_change",
                        contain:"#ColumnTableData_mess",
                        prePageSize:data.result.pageSize,
                        prepageNo:data.result.pageNo,
                        add_data:{content:search_val}
                    });//生成分页;
                }
                //console.log(data.result);
                //console.log(data);
                set_seqsum(
                    {
                        pageNo:data.result.pageNo,
                        pageSize:data.result.pageSize
                    }
                );
                //var temp=data.result.resultList;
                //data.result=data.result.resultList;
                //console.
                mccmsa.getHtmlFromLocalTemplate({   //将数据打包到模版丢进容器
                    templateId:"getColumnTableData_mess_change",
                    container:$("#ColumnTableData_mess"),
                    data: data,
                    callbakc:function(){

                    }
                })
            }
        })
    })
    var pre_ran;
    mccmsa.ajax({
        url: "messageController/feedbackInfo",
        method: "get",
        data: {pageSize: 10, pageNo: 1},
        success: function (data) {
            //console.log(data);
            set_seqsum(
                {
                    pageNo:data.result.pageNo,
                    pageSize:data.result.pageSize
                }
            )
            create_page({
                url:"messageController/feedbackInfo",
                method:"get",
                data:data,
                temp:"getColumnTableData_mess",
                contain:"#ColumnTableData_mess",
                prePageSize:data.result.pageSize,
                prepageNo:data.result.pageNo
            })//生成分页
          //console.log(data);
            mccmsa.getHtmlFromLocalTemplate({   //将数据打包到模版丢进容器
                templateId:"getColumnTableData_mess",
                container:$("#ColumnTableData_mess"),
                data: data,
                callback:function(){
                }
            });
        }
    })
}